﻿<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>我的积分 - {site.name}</title>
<link rel="stylesheet" type="text/css" href="<%templateskin%>/jqmobi/css/icons.css" />
<link rel="stylesheet" type="text/css" href="<%templateskin%>/jqmobi/css/af.ui.base.css" />
<link rel="stylesheet" type="text/css" href="<%templateskin%>/css/style.css" />
<link rel="stylesheet" type="text/css" href="{config.webpath}scripts/artdialog/ui-dialog.css" />
<!--jqMobi主JS-->
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/jqmobi/jq.appframework.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/jqmobi/ui/appframework.ui.js"></script>
<!--jqMobi插件-->
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/jqmobi/plugins/jq.slidemenu.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/artdialog/dialog-plus-min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin%>/js/base.js"></script>
<script type="text/javascript">
	$(document).ready(function(e) {
        $(".page-list a").attr("data-ignore",true);
    });
</script>
</head>

<body>
<div id="afui">
  <div id="content">

	<div id="mainPanel" class="panel">
    <%if {action}=="convert"%>
    <!--积分兑换-->
      <script type="text/javascript" src="{config.webpath}scripts/jquery/Validform_v5.3.2_min.js"></script>
      <script type="text/javascript">
      $(function(){
        //初始化表单
        AjaxInitForm('#point_form', '#btnSubmit', 1, '#turl');
      });
    </script>
      <header>
        <a href="javascript:;" onclick="history.back(-1);" class="backButton">返回</a>
        <h1>积分兑换</h1>
        <a onclick="$.ui.toggleSideMenu()" class="menuButton"></a>
      </header>
      <form id="point_form" name="point_form" url="{config.webpath}tools/submit_ajax.ashx?action=user_point_convert">
        <div class="form-box">
          <dl>
            <dt>账户余额</dt>
            <dd>￥{userModel.amount}</dd>
          </dl>
          <dl>
            <dt>账户积分</dt>
            <dd>{userModel.point} 分</dd>
          </dl>
          <dl>
            <dt>兑换说明</dt>
            <dd>积分兑换最少金额为1元，兑换比例为：1元等于{uconfig.pointcashrate}个积分</dd>
          </dl>
          <div><input name="txtAmount" id="txtAmount" type="text" placeholder="请输入兑换积分金额(元)" datatype="n"  nullmsg="请输入金额" sucmsg=" " /></div>
          <div><input name="txtPassword" id="txtPassword" type="password" placeholder="请输入登录密码" datatype="*6-20" nullmsg="请输入密码" sucmsg=" "></div>
          <div><input id="btnSubmit" name="btnSubmit" type="submit" value="确认兑换" class="btn orange full" /></div>
        </div>
      </form>
      <input id="turl" name="turl" type="hidden" value="<%linkurl("userpoint","convert")%>" />
      
      <!--版权信息-->
      <%template src="_copyright.html"%>
      <!--/版权信息-->
      
      <footer>
        <a href="<%linkurl("userpoint","convert")%>" data-ignore="true" class="icon tag pressed">积分兑换</a>
        <a href="<%linkurl("userpoint","list")%>" data-ignore="true" class="icon clock">积分明细</a>
      </footer>
    <!--/积分兑换-->
    
    <%else if(action=="list")%>
    <!--积分明细-->
      <script type="text/javascript">
		  function ExecPostBack(checkValue) {
			  if (arguments.length == 1) {
				  ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_point_delete', checkValue, '#turl');
			  }else{
				  var valueArr = '';
				  $("input[name='checkId']:checked").each(function(i){
					  valueArr += $(this).val();
					  if(i < $("input[name='checkId']:checked").length - 1){
						  valueArr += ","
					  }
				  });
				  ExecDelete('{config.webpath}tools/submit_ajax.ashx?action=user_point_delete', valueArr, '#turl');
			  }
		  }
	  </script>
      <header>
        <a href="javascript:;" onclick="history.back(-1);" class="backButton">返回</a>
        <h1>积分明细</h1>
        <a onclick="$.ui.toggleSideMenu()" class="menuButton"></a>
      </header>
      
      <!--操作按钮-->
      <div class="select-bar">
        <div class="col">
          <a href="javascript:;" onclick="checkAll(this);" class="icon-check">全选</a>
        </div>
        <div class="col">
          <a href="javascript:;" onclick="ExecPostBack();" class="icon-trash">删除</a>
        </div>
      </div>
      <!--/操作按钮-->
      
      <div>
        <ul class="detail-list">
          <%set DataTable list=get_user_point_list(10, page, "user_id="+userModel.id, out totalcount)%> <!--取得一个DataTable-->
          <%set string pagelist=get_page_link(10, page, totalcount, "userpoint", action, "__id__")%> <!--取得分页页码列表-->
          <%foreach(DataRow dr in list.Rows)%>
          <li>
            <input id="checkId-{dr[id]}" name="checkId" class="checkall" type="checkbox" value="{dr[id]}" >
            <label for="checkId-{dr[id]}">
              <h4><span>
              <%if({strtoint({dr[value]})}>0)%>
              +{dr[value]}
              <%else%>
              {dr[value]}
              <%/if%>
              </span>{dr[remark]}</h4>
              <p>{dr[add_time]}</p>
            </label>
          </li>
           <%/foreach%>
        </ul>
      </div>
      <input id="turl" type="hidden" value="<%linkurl("userpoint","list")%>" />
      
      <!--分页页码-->
      <div class="page-list">{pagelist}</div>
      <!--/分页页码-->
      
      <!--版权信息-->
      <%template src="_copyright.html"%>
      <!--/版权信息-->
      
      <footer>
        <a href="<%linkurl("userpoint","convert")%>" data-ignore="true" class="icon tag">积分兑换</a>
        <a href="<%linkurl("userpoint","list")%>" data-ignore="true" class="icon clock pressed">积分明细</a>
      </footer>
      
    <!--/积分明细-->
    <%/if%>
    
	</div>
    
    <!--左侧导航-->
    <%template src="_nav.html"%>
    <!--/左侧导航-->
      
  </div>
</div>
</body>
</html>
